package com.liang.frpdemo;

public class DefaultApi implements Api {

	@Override
	public void getLocation(String address, final LocationCallBack getCallBack) {
		new Thread(new Runnable() {

			@Override
			public void run() {
				try {
					Thread.sleep(1000);
					LocationBean bean = new LocationBean();
					bean.lat = 0;
					bean.lon = 0;
					getCallBack.onLocationReceived(bean);
					LogUtils.e("定位成功");
				} catch (InterruptedException e) {
					e.printStackTrace();
					getCallBack.onError(e);
					LogUtils.e("定位失败");
				}
			}
		}).start();
	}

	@Override
	public void submitLocation(LocationBean bean, final SubmitCallBack submitCallBack) {
		new Thread(new Runnable() {

			@Override
			public void run() {
				try {
					Thread.sleep(1000);
					submitCallBack.onSubmitReceived();
					LogUtils.e("提交成功");
				} catch (InterruptedException e) {
					e.printStackTrace();
					submitCallBack.onError(e);
					LogUtils.e("提交失败");
				}
			}
		}).start();
	}

}
